﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Admin_Default : System.Web.UI.Page
{
    DADataContext da = new DADataContext();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (string.IsNullOrEmpty(Convert.ToString(Session["user"])))
            {
                Response.Redirect("/Online/Dangnhap.aspx");
            }
            else
            {
                var icon = from cn in da.Chucnangs where (from tkh in da.TaikhoanChucnangs where tkh.Taikhoan == Session["user"].ToString() && tkh.Machucnang != 0 select tkh.Machucnang).Contains(cn.Machucnang) select new { cn.Duongdan, cn.Tenchucnang, cn.Icon };
                dlicon.DataSource = icon;
                dlicon.DataBind();
            }
        }
    }
}
